Android UI(RadioButton)详解

您所在的位置:网站首页 android 自定义radiobutton Android UI(RadioButton)详解

Android UI(RadioButton)详解

#Android UI(RadioButton)详解| 来源: 网络整理| 查看: 265

目录:     1.应用场景           2.RadioButton一些重要属性            3.RadioButton简单使用         4.动态添加RadioButton选项         5.RadioButton自定义

1.应用场景     应用于在多项中只能选取单项的情况,例如性别,但必须与RadioGroup结合使用,如果单独使用的话无法达到单选的结果      2.RadioButton一些重要属性      1.RadioGroup常用属性         指定选项横向排列:android:orientation="horizontal"         指定选项纵向排列:android:orientation="vertical"              2.设置RadioButton颜色(API level> = 21):android:buttonTint="@color/your_color"          3.在自定义背景的时候设置android:button="@null",盖掉原背景          4.设置文字在左,图片在右(下面属性一起设置)       android:button="@null"       android:drawableRight="@android:drawable/btn_radio"                          ps:RadioButton与Checkbox的区别在于RadioButton选择后不能再点击取消选择,只能选择其他项,取消前一项的选择 

3.RadioButton简单使用

    1.xml布局



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3